use crate::dao;
use crate::models::models::components::v2ray::subscription::ComponentV2raySubscription;
use crate::runtime::response::MagicBoxResponse;
use crate::runtime::result::MagicBoxResult;

#[tauri::command(rename_all = "snake_case")]
pub(crate) async fn invoke_component_v2ray_subscriptions() -> MagicBoxResult<MagicBoxResponse<Vec<ComponentV2raySubscription>>> {
    let subscriptions = dao::components::v2ray::subscription::get_subscription_configs()?;

    Ok(MagicBoxResponse::new_success(subscriptions))
}